@import './variables';

* {
  box-sizing: border-box;
  outline: none;
}

html {
  font-size: 14px;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.2em;
  background-color: #fff;
}

a {
  color: #555555;
}


@each $colorKey, $color in $colors {
  // 文字颜色
  .text-#{$colorKey} {
    color: $color;
  }
  // 背景颜色
  .bg-#{$colorKey} {
    background-color: $color;
  }
}

// 文字对齐方式
@each $var in (left, center, right) {
  .text-#{$var} {
    text-align: $var;
  }
}


@each $sizeKey, $size in $font-sizes {
  .fs-#{$sizeKey} {
    font-size: $size * $base-font-size;
  }
}

// width, height
.w-100 {
  width: 100%;
}
.w-49 {
  width: 49%;
}
.h-100 {
  height: 100%;
}

// flex
.d-flex {
  display: flex;
}
// 垂直方向
.flex-column {
  flex-direction: column;
}
@each $key, $value in $flex-jc {
  .jc-#{$key} {
    justify-content: $value;
  }
}
@each $key, $value in $flex-ai {
  .ai-#{$key} {
    align-items: $value;
  }
}

.flex-1 {
  flex: 1;
}

@each $typeKey, $type in $spacing-types {
  // .m-1
  @each $sizeKey, $size in $spacing-sizes {
    .#{$typeKey}-#{$sizeKey} {
      #{$type}: $size * $spacing-base-size;
    }
  }
  // .mx-1, .my-1
  @each $sizeKey, $size in $spacing-sizes {
    .#{$typeKey}x-#{$sizeKey} {
      #{$type}-left: $size * $spacing-base-size;
      #{$type}-right: $size * $spacing-base-size;
    }
    .#{$typeKey}y-#{$sizeKey} {
      #{$type}-top: $size * $spacing-base-size;
      #{$type}-bottom: $size * $spacing-base-size;
    }
  }
  @each $directionKey, $direction in $spacing-directions {
    @each $sizeKey, $size in $spacing-sizes {
      // .mt-1 { margin-top: 0.25rem; }
      .#{$typeKey}#{$directionKey}-#{$sizeKey} {
        #{$type}-#{$direction}: $size * $spacing-base-size;
      }
    }
  }
}